

export const isEmpty = (obj) => {
    if (typeof obj === 'undefined' || obj === null || obj === '') {
        return true;
    } else {
        return false;
    }
}

export const preProcessData = (formData) => {
    /* 删除空值 */
    Object.keys(formData).forEach(item => {
        if (isEmpty(formData[item])) {
            delete formData[item];
        }
    })
    return formData;
}
//对导航栏进行数据处理
export const dataDispose = (data) => {
    let newArray = [];
    data.forEach((element) => {
        let dataV = [];
        if (element.hasOwnProperty('page')) {
            element.page.forEach((item) => {
                dataV.push(item);
            });
            newArray = [...newArray, ...dataV];
        } else {
            newArray = [...newArray, ...data];
        }

    });
    return newArray;
};